using JT808Protocol.Common;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace JT808Protocol.Models.BodyParserStrategy
{
    public class DpAnswer_0x0302 : IJT808Body
    {
        /// <summary>
        /// 应答流水号
        /// </summary>
        [JsonPropertyName("应答流水号")] public ushort SerialNumer;

        /// <summary>
        /// 答案 id
        /// </summary>
        [JsonPropertyName("应答ID")] public byte AnswerID;

        public override IJT808Body ReadBody(ReadOnlySpan<byte> data, ref int index)
        {
            SerialNumer = ParseHelper.Uint16(ref data, 0);
            AnswerID = data[2];

            return this;
        }

        public override List<byte> WriteToBytes()
        {
            throw new NotImplementedException();
        }
    }
}